home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Video Toaster 4.3
/
Video Toaster v4.3.iso
/
4.2
/
arexx
/
editor
/
startupscripts
/
measure.rexx
< prev
Wrap
OS/2 REXX Batch file
|
1998-04-16
|
2KB
|
104 lines
/* Mesure.rexx V1.1 -- Measure between 2 selected clips. */
/* By Bob Caron (Grue) ©1995 NewTek Inc. */
arg frompopup
set numeric 12
if frompopup="" then frompopup=0
frompopup=1
call remlib('PROJECT_REXX_PORT')
call addlib('PROJECT_REXX_PORT',0)
if frompopup=0 then do
call req_tell("Measure V1.0","This script can only be run","from the tools popup.")
call quit()
end
call set_view(2)
call req_error("Measure V1.0 --- Total time from in point (Clip 1) to out point (Clip 2)")
project_end=croutonsinproject()
location=1
do count=1 to project_end
if croutonselectedpos(count)=1 then do
selected.location=count-1
location=location+1
end
end
location=location-1
if location<=0 then do
call req_tell("Measure V1.0"," You need to select two"," croutons Measure between.")
call quit()
end
fields=0
do count=selected.1 to selected.location
if crnumtype(count)="CLIP" | crnumtype(count)=" STIL" | crnumtype(count)="FRAM" then
fields=fields+crnumgettag(count,Duration)
end
hours=0
minutes=0
seconds=0
frame=0
fields=F2D(fields)
if fields>=216000 then do
hours=fields%216000
fields=fields-(hours*216000)
end
if fields>=3600 then do
minutes=fields%3600
fields=fields-(minutes*3600)
end
if fields>=60 then do
seconds=fields%60
fields=fields-(seconds*60)
end
frames=(fields%2)
time=req_tell("Total time of clips:"," "||right('00'||hours,2)||":"||right('00'||minutes,2)||":"||right('00'||seconds,2)||":"||right('00'||frames,2))
call projectupdate()
call req_error("")
call remlib("PROJECT_REXX_PORT")
exit
quit:
call req_error("Canceled.")
call remlib("PROJECT_REXX_PORT")
exit
croutonselectedpos:
arg pos
row=pos%8
col=pos-(row*8)
row=row+1
return croutonselected(row,col)
F2D: PROCEDURE /* Convert Fields to dropframe. */
arg fields
ticks=fields%2
extra=0;frms=ticks
do while (ticks >= 17982)
extra = extra + 2 * 9
ticks = ticks - 17982
end
if ticks >= 2 then
extra = extra + 2 * ((ticks-2)%1798)
/* Ouchy! Dropframe is such a pain!!!! */
return((frms+extra)*2)